# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Hugo Ideler <hugoideler@dse.nl>

pkgname=pystatgrab
pkgver=0.7.1
pkgrel=3
pkgdesc="Python bindings for libstatgrab"
arch=('loong64' 'x86_64')
url="https://www.i-scream.org/pystatgrab"
license=('GPL')
depends=('python' 'libstatgrab')
makedepends=('cython')
validpgpkeys=('4BD95F908A5040E8D26CD6816C226B37FDF38D55') # Tim Bishop <tim@bishnet.net>
source=(https://ftp.i-scream.org/pub/i-scream/$pkgname/$pkgname-$pkgver.tar.gz{,.asc})
sha256sums=('40a71a0e915df1cc8874bdcd52d2a34c8fa234915f2021c137934321ac886e9f'
            'SKIP')

prepare() {
  cd "${srcdir}"/$pkgname-$pkgver

  # Remove shipped copy of statgrab.c so it is regenerated with
  # newer Cython (>= 0.27.3) that is compatible with Python 3.7
  rm statgrab.c
}

package() {
  cd "${srcdir}"/$pkgname-$pkgver

  python setup.py build
  python setup.py install --prefix="${pkgdir}"/usr
}
